"""二维差分"""
def build(diff_array):
    for i in range(1, len(diff_array)):
        for j in range(1, len(diff_array)):
            diff_array[i][j] += diff_array[i-1][j] + diff_array[i][j-1] - diff_array[i-1][j-1]
    return diff_array

def add(nums, v, n):
    # 创建一个 n+1 行 n+1 列的二维数组，初始值为 0
    diff_array = [[0] * (n + 1) for _ in range(n + 1)]
    for num in nums:
        a, b, c, d = num
        diff_array[a][b] += v
        if d + 1 <= n:
            diff_array[a][d + 1] -= v
        if c + 1 <= n:
            diff_array[c + 1][b] -= v
        if c + 1 <= n and d + 1 <= n:
            diff_array[c + 1][d + 1] += v
    return build(diff_array)

n, times = map(int, input().split())
nums = []
for i in range(times):
    num = list(map(int, input().split()))
    nums.append(num)

result = add(nums, 1, n) 
for i in range(1, len(result)):
    for j in range(1, len(result)):
        print(result[i][j], end=' ')
    print()